﻿using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using Oragon.Architecture.Data.SqlBuilder;
using Oragon.Architecture.Data.QueryBuilder.SqlServer;

namespace Oragon.Architecture.Data.QueryBuilder.Tests
{
	[TestFixture]
	public class InsertSQLBuilderTest
	{
		[Test]
		public void InsertSQLBuilderTest_1()
		{
			InsertSQLBuilder target = new InsertSQLBuilder(); // TODO: Initialize to an appropriate value
			target.TableName = LiteralManager.GetLiteralBuilder().BuildTableName("dataBaseName.dbo.tableOfView");
			target.CollumnsAndValues.Add(
					new SetItem(
						LiteralManager.GetLiteralBuilder().BuildColumnName("columnName01"), 
						LiteralManager.GetLiteralBuilder().BuildParameter("columnName01")
					)
			);
			target.CollumnsAndValues.Add(
					new SetItem(
						LiteralManager.GetLiteralBuilder().BuildColumnName("columnName02"), 
						LiteralManager.GetLiteralBuilder().BuildParameter("columnName02")
					)
			);
			string actual = target.ToSQL() + LiteralManager.GetLiteralBuilder().GetLastIdentity(null).ToSQL();
			
			Assert.AreEqual(Oragon.Architecture.Data.QueryBuilder.Tests.Properties.Resources.InsertSQLBuilderTest_1, actual.Trim());
		}

	}
}
